<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Insert title here</title>
<script type="text/javascript" src="${ctx}/js/jquery-1.10.2.js"></script>
<script type="text/javascript">
$(function(){
	$.getJSON('${ctx}/ajaxlistdata',function(data){
		$('#list tbody').html('');
		if(data && data.data){
			$.each(data.data,function(i, obj){
				$('#list tbody').append("<tr><td>"+obj.id+"</td><td>"+obj.message+"</td></tr>");
			});			
		}
	});
	$.getJSON('${ctx}/ajaxlistdata2',function(data){
		$('#list2 tbody').html('');
		if(data){
			$.each(data,function(i, obj){
				$('#list2 tbody').append("<tr><td>"+obj.id+"</td><td>"+obj.message+"</td></tr>");
			});			
		}
	});
});
</script>
</head>
<body>
<h1>MessageBook List by return ModelAndView</h1>
<table id="list">
	<thead>
		<th>id</th>
		<th>message</th>
	</thead>
	<tbody>
		
	</tbody>
</table>
<h1>MessageBook List by return Object</h1>
<table id="list2">
	<thead>
		<th>id</th>
		<th>message</th>
	</thead>
	<tbody>
		
	</tbody>
</table>
</body>
</html>